package com.tedu.servies;



import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tedu.mapper.AddressMapper;
import com.tedu.pojo.Address;

import com.tedu.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class AddressServiesImpl implements AddressServies{



    @Autowired
    AddressMapper addressMapper;


    public int updateaddress(Address address){
        address.setUpdated(new Date());
        int sc = addressMapper.insert(address);
        return sc;
    }

    public List<Address> getid(int user_id){
        System.out.println(user_id);
        QueryWrapper<Address>  wrapper = Wrappers.query();
        wrapper.eq("user_id",user_id);

        List<Address> addresses = addressMapper.selectList(wrapper);
        System.out.println("登录地址成功的用户："+addresses);
        return addresses;
    }
}
